const state = {
    userSongList:localStorage.getItem('userSongList') ? JSON.parse(localStorage.getItem('userSongList')) : [],
    likeSongIds:localStorage.getItem('likeSongIds') ? JSON.parse(localStorage.getItem('likeSongIds')) : []
};

const mutations = {
    SAVEUSERSONGLIST(state,songList){
        state.userSongList = songList;
    },
    SAVEUSERLIKESONGLIST(state,likeSongIds){
        state.likeSongIds = likeSongIds
    }
};
const actions = {
    // 保存用户的歌单
    saveUserSongList({commit},songList){
        commit('SAVEUSERSONGLIST',songList)
    },
    	// 用户喜欢的音乐id列表
	saveLikeSongIds({ commit }, likeSongIds) {
		commit("SAVEUSERLIKESONGLIST", likeSongIds);
	},
};
const getters = {};
export default {
    state,
    actions,
    mutations,
    getters
}